From: Colin Walters Date: Tue, 30 Jun 2009 21:37:27 +0000 (-0400) Subject: Fix double free and under-dup in ShellAppMonitor X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~11247 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8f0bf5deae7463801c9da42e35e21f51a3077c50;p=gnome-shell.git Fix double free and under-dup in ShellAppMonitor The hash table is keeping ownership of appid, we don't need to free it again. However we do need to re-dup it when we insert as a key. --- diff --git a/src/shell-app-monitor.c b/src/shell-app-monitor.c index 6edf824dc..87b7f6c22 100644 --- a/src/shell-app-monitor.c +++ b/src/shell-app-monitor.c @@ -347,12 +347,12 @@ shell_app_monitor_on_window_removed (MetaWorkspace *workspace, if (window_count == 0) { g_hash_table_remove (self->running_appids, appid); - g_free (appid); g_signal_emit (self, signals[CHANGED], 0); } else { - g_hash_table_insert (self->running_appids, appid, GUINT_TO_POINTER (window_count)); + g_hash_table_insert (self->running_appids, g_strdup (appid), + GUINT_TO_POINTER (window_count)); } g_hash_table_remove (self->window_to_appid, window); }